<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>css3动画</title>
    <style>
        * {
            margin: 0;
            padding: 0
        }

        div {
            width: auto;
            border: 1px solid #333;
            font-size: 0;
            overflow: hidden;
        }

        img:hover {
            transform: scale(1.5);
        }

        img {
            transition: all 5s;
            width: 200px;
        }

        .parent {
            width: 300px;
            height: 300px;
            background: url('../images/精神状态.gif') no-repeat center center;
            background-size: cover;
            border: 1px solid #333;
            position: relative;
            overflow: hidden;
        }
        .cover {
            position: absolute;
            width: 100%;
            height: 100%;
            /* right:-100%; */
            bottom: 0;
            background: rgba(209, 123, 123, .5);
            transition: all 1s;
            transform-origin: left top;
           
        }
        .parent:hover .cover{
            transform: rotate(-90deg)
            
        }


        @keyframes rotate {
            0%{
                transform: rotate(0deg);
            }
            25%{
                transform: rotate(90deg);
            }
            50%{
                transform: rotate(180deg);
            }
            75%{
                transform: rotate(270deg);
            }
            100%{
                transform: rotate(360deg);
            }
        }
        /* animation-play-state	规定动画是运行还是暂停。 */
        .box{
            width:100px;
            height: 100px;
            background-color: red;
            margin:100px;
            animation: rotate 5s linear infinite;
            /* animation-play-state: paused; */
            animation-play-state: running;
        }
        .box:hover{
           /* animation-play-state: running; */
           animation-play-state: paused;
        }


    </style>
</head>

<body>
    <div>
        <img src="../images/精神状态.gif" alt="">
    </div>

    <div class="parent">
        <div class="cover">
        </div>
    </div>

    <div class="box">
    
    </div>

</body>
</html>